home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #11 / Amiga Plus CD - 2004 - No. 11.iso / AmiSoft / Dev / misc / temgen.lha / Temgen / Amigamain / Example3 / app_strings.h < prev    next >
C/C++ Source or Header  |  2004-06-26  |  4KB  |  173 lines

  1. #ifndef APP_STRINGS_H
  2. #define APP_STRINGS_H
  3.  
  4.  
  5. /****************************************************************************/
  6.  
  7.  
  8. /* This file was created automatically by CatComp.
  9.  * Do NOT edit by hand!
  10.  */
  11.  
  12.  
  13. #ifndef EXEC_TYPES_H
  14. #include <exec/types.h>
  15. #endif
  16.  
  17. #ifdef CATCOMP_ARRAY
  18. #undef CATCOMP_NUMBERS
  19. #undef CATCOMP_STRINGS
  20. #define CATCOMP_NUMBERS
  21. #define CATCOMP_STRINGS
  22. #endif
  23.  
  24. #ifdef CATCOMP_BLOCK
  25. #undef CATCOMP_STRINGS
  26. #define CATCOMP_STRINGS
  27. #endif
  28.  
  29.  
  30. /****************************************************************************/
  31.  
  32.  
  33. #ifdef CATCOMP_NUMBERS
  34.  
  35. #define MSG_OK 0
  36. #define MSG_REQTITLE 1
  37. #define MSG_ERR_LIB 2
  38. #define MSG_ERR_SHELL 3
  39. #define MSG_ERR_WB 4
  40. #define MSG_ERR_RAM 5
  41. #define MSG_ERR_TOOLTYPES 6
  42. #define MSG_ERR_READARGS 7
  43. #define MSG_ERR_OPEN 8
  44. #define MSG_SWAP_DEMO 9
  45.  
  46. #endif /* CATCOMP_NUMBERS */
  47.  
  48.  
  49. /****************************************************************************/
  50.  
  51.  
  52. #ifdef CATCOMP_STRINGS
  53.  
  54. #define MSG_OK_STR "OK"
  55. #define MSG_REQTITLE_STR "Problem"
  56. #define MSG_ERR_LIB_STR "Couldn't open %s %ld\n"
  57. #define MSG_ERR_SHELL_STR "Application can't be started from Shell\n"
  58. #define MSG_ERR_WB_STR "Application can't be started from Workbench\n"
  59. #define MSG_ERR_RAM_STR "Couldn't allocate RAM in function %s\n"
  60. #define MSG_ERR_TOOLTYPES_STR "Couldn't read tooltypes\n"
  61. #define MSG_ERR_READARGS_STR "Couldn't read command line arguments\n"
  62. #define MSG_ERR_OPEN_STR "Couldn't open stream %s\n"
  63. #define MSG_SWAP_DEMO_STR "String %s and value %ld\n"
  64.  
  65. #endif /* CATCOMP_STRINGS */
  66.  
  67.  
  68. /****************************************************************************/
  69.  
  70.  
  71. #ifdef CATCOMP_ARRAY
  72.  
  73. struct CatCompArrayType
  74. {
  75.     LONG   cca_ID;
  76.     STRPTR cca_Str;
  77. };
  78.  
  79. static const struct CatCompArrayType CatCompArray[] =
  80. {
  81.     {MSG_OK,(STRPTR)MSG_OK_STR},
  82.     {MSG_REQTITLE,(STRPTR)MSG_REQTITLE_STR},
  83.     {MSG_ERR_LIB,(STRPTR)MSG_ERR_LIB_STR},
  84.     {MSG_ERR_SHELL,(STRPTR)MSG_ERR_SHELL_STR},
  85.     {MSG_ERR_WB,(STRPTR)MSG_ERR_WB_STR},
  86.     {MSG_ERR_RAM,(STRPTR)MSG_ERR_RAM_STR},
  87.     {MSG_ERR_TOOLTYPES,(STRPTR)MSG_ERR_TOOLTYPES_STR},
  88.     {MSG_ERR_READARGS,(STRPTR)MSG_ERR_READARGS_STR},
  89.     {MSG_ERR_OPEN,(STRPTR)MSG_ERR_OPEN_STR},
  90.     {MSG_SWAP_DEMO,(STRPTR)MSG_SWAP_DEMO_STR},
  91. };
  92.  
  93. #endif /* CATCOMP_ARRAY */
  94.  
  95.  
  96. /****************************************************************************/
  97.  
  98.  
  99. #ifdef CATCOMP_BLOCK
  100.  
  101. static const char CatCompBlock[] =
  102. {
  103.     "\x00\x00\x00\x00\x00\x04"
  104.     MSG_OK_STR "\x00\x00"
  105.     "\x00\x00\x00\x01\x00\x08"
  106.     MSG_REQTITLE_STR "\x00"
  107.     "\x00\x00\x00\x02\x00\x16"
  108.     MSG_ERR_LIB_STR "\x00"
  109.     "\x00\x00\x00\x03\x00\x2A"
  110.     MSG_ERR_SHELL_STR "\x00\x00"
  111.     "\x00\x00\x00\x04\x00\x2E"
  112.     MSG_ERR_WB_STR "\x00\x00"
  113.     "\x00\x00\x00\x05\x00\x26"
  114.     MSG_ERR_RAM_STR "\x00"
  115.     "\x00\x00\x00\x06\x00\x1A"
  116.     MSG_ERR_TOOLTYPES_STR "\x00\x00"
  117.     "\x00\x00\x00\x07\x00\x26"
  118.     MSG_ERR_READARGS_STR "\x00"
  119.     "\x00\x00\x00\x08\x00\x1A"
  120.     MSG_ERR_OPEN_STR "\x00\x00"
  121.     "\x00\x00\x00\x09\x00\x1A"
  122.     MSG_SWAP_DEMO_STR "\x00\x00"
  123. };
  124.  
  125. #endif /* CATCOMP_BLOCK */
  126.  
  127.  
  128. /****************************************************************************/
  129.  
  130.  
  131. struct LocaleInfo
  132. {
  133.     APTR li_LocaleBase;
  134.     APTR li_Catalog;
  135. };
  136.  
  137.  
  138. #ifdef CATCOMP_CODE
  139.  
  140. STRPTR GetString(struct LocaleInfo *li, LONG stringNum)
  141. {
  142. LONG   *l;
  143. UWORD  *w;
  144. STRPTR  builtIn;
  145.  
  146.     l = (LONG *)CatCompBlock;
  147.  
  148.     while (*l != stringNum)
  149.     {
  150.         w = (UWORD *)((ULONG)l + 4);
  151.         l = (LONG *)((ULONG)l + (ULONG)*w + 6);
  152.     }
  153.     builtIn = (STRPTR)((ULONG)l + 6);
  154.  
  155. #undef LocaleBase
  156. #define LocaleBase li->li_LocaleBase
  157.     
  158.     if (LocaleBase)
  159.         return(GetCatalogStr(li->li_Catalog,stringNum,builtIn));
  160. #undef LocaleBase
  161.  
  162.     return(builtIn);
  163. }
  164.  
  165.  
  166. #endif /* CATCOMP_CODE */
  167.  
  168.  
  169. /****************************************************************************/
  170.  
  171.  
  172. #endif /* APP_STRINGS_H */
  173.